﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<TBlog.Models.ViewData.PostModel>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server"></asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

        <% var p = Model.Posts.FirstOrDefault(); %>
        <% if (p != null) { %>
        <%-- <!-- main --> --%>
		<div id="main" class="grid_8">
			<h2><a href="" rel="bookmark" title="Permanent Link to "><%=p.post_title %></a></h2>
			<p class="post-info">Posted by <%=p.post_author %> | Filed under <%=p.post_category_id %></p>
			Read the rest of this entry...
            <p>Tags: aaa,bbb,ccc</p>
			<p class="postmeta">
			    <a href="" class="readmore">Read more</a> |
			    <a href="" class="comments">Comments (0)</a> |	
			    <span class="date"><%=p.post_date.ToLongDateString() %></span>
			</p>
            <%-- <?php endwhile; ?> --%>

			<div class="alignleft">
            <%
               if (Model.Posts.HasPreviousPage)
               {
                   Response.Write(Html.ActionLink(ConfigurationManager.AppSettings["newer_entries"], "Category/" + p.Category.category_id + "/" + (Model.Posts.PageIndex - 1)));
               } 
            %>
            </div>

            <div class="alignright">
            <%
               if (Model.Posts.HasNexePage)
               {
                   Response.Write(Html.ActionLink(ConfigurationManager.AppSettings["older_entries"], "Category/" + p.Category.category_id + "/" + (Model.Posts.PageIndex + 1)));
               } 
            %>
            </div>
		</div>
        <%-- <!-- main ends --> --%>
        <% } %>
</asp:Content>
